Skip to content

根据过滤条件查询用户券

服务商自定义筛选条件(如创建商户号、归属商户号、发放商户号等),查询指定微信用户卡包中满足对应条件的所有商家券信息。

请求参数类型描述
openidstring用户标识
queryobject声明请求的查询参数
appidstring公众账号ID
stock_idstring批次号
coupon_statestring券状态
SENDED | USED | EXPIRED 枚举值之一
creator_merchantstring创建批次的商户号
belong_merchantstring批次归属商户号
sender_merchantstring批次发放商户号
offsetnumber分页页码
limitnumber分页大小
php
$instance->v3->marketing->busifavor->users->_openid_->coupons->getAsync([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/busifavor/users/{openid}/coupons')->getAsync([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/busifavor/users/{openid}/coupons']->getAsync([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->busifavor->users->_openid_->coupons->get([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/busifavor/users/{openid}/coupons')->get([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/busifavor/users/{openid}/coupons']->get([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
total_countnumber总数量
offsetnumber分页页码
limitnumber分页大小
dataobject[]结果集
stock_namestring商家券批次名称
belong_merchantstring批次归属商户号
commentstring批次备注
goods_namestring适用商品范围
stock_typestring批次类型(NORMAL:固定面额满减券批次 DISCOUNT:折扣券批次 EXCHANGE:换购券批次)
NORMAL | DISCOUNT | EXCHANGE 枚举值之一
coupon_use_ruleobject核销规则
coupon_available_timeobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
available_day_after_receiveinteger领取后N天内有效
available_weekobject固定周期有效时间段
week_dayinteger[]可用星期数(0代表周日,1代表周一,以此类推)
0 | 1 | 2 | 3 | 4 | 5 | 6 枚举值之一
available_day_timeobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregulary_avaliable_timeobject[]无规律的有效时间段
begin_timestring开始时间
end_timestring结束时间
fixed_normal_couponobject固定面额满减券使用规则
discount_amountinteger优惠金额
transaction_minimuminteger消费门槛
discount_couponobject折扣券使用规则
discount_percentinteger折扣比例
transaction_minimuminteger消费门槛
exchange_couponobject换购券使用规则
exchange_priceinteger单品换购价
transaction_minimuminteger消费门槛
use_methodstring核销方式(OFF_LINE:线下滴码 MINI_PROGRAMS:线上小程序 PAYMENT_CODE:微信支付付款码 SELF_CONSUME:用户自助)
OFF_LINE | MINI_PROGRAMS | PAYMENT_CODE | SELF_CONSUME 枚举值之一
mini_programs_appidstring小程序appid
mini_programs_pathstring小程序path
custom_entranceobject自定义入口
mini_programs_infoobject小程序入口
mini_programs_appidstring商家小程序appid
mini_programs_pathstring商家小程序path
entrance_wordsstring入口文案
guiding_wordsstring引导文案
appidstring商户公众号appid
hall_idstring更多优惠入口;营销馆创建地址
store_idstring可用门店id
code_display_modestringcode展示模式
display_pattern_infoobject样式信息
descriptionstring使用须知
merchant_logo_urlstring商户logo
merchant_namestring商户名称
background_colorstring背景颜色
Color010 | Color020 | Color030 | Color040 | Color050 | Color060 | Color070 | Color080 | Color090 | Color100 枚举值之一
coupon_image_urlstring券详情图片
finder_infoobject视频号相关信息
finder_idstring视频号ID
finder_video_idstring视频号视频ID
finder_video_cover_image_urlstring视频号封面图
coupon_codestring券code
coupon_statestring券状态
SENDED | USED | EXPIRED 枚举值之一
stock_idstring批次号
transferableboolean是否允许转赠
shareableboolean是否允许分享链接
send_request_nostring发券请求单号
use_request_nostring核销请求单号
available_start_timestring券可使用开始时间
expire_timestring券过期时间
receive_timestring券领券时间
use_timestring券核销时间

参阅 官方文档 官方文档 官方文档 官方文档

Published on the GitHub by TheNorthMemory